/*
 * Classe Champ contient des données, stocké depuis xml
 * 
 */

package gestion_de_mp3.Modeles;

import org.w3c.dom.Node;

/**
 *
 * @author bigfriendvn
 */
public class Champ {
    private int id;
    private String data=null;
    private String balise;
    private Entite entite = null;
        
     public Champ(int id){
        this.id=id;
    }
     public Champ(String balise, Node n){
        this.balise=balise;
        entite = new Entite(balise);
        entite.parcourirListeType(n);
     }
     public Champ(String balise,String data){
        this.balise=balise;
        this.data=data;
    }
 
     public Champ(String balise,int id){
        this.id=id;
        this.balise=balise;
    }

     public void setBalise(String b)
     {
      balise=b;
      }
    public String getBalise()
    {
     return balise;
    }
     public int getId(){
        return id;
     }
     public Entite getEntite(){
        return entite;
     }
     public String getData(){
        return data;
     }
  
    @Override
     public String toString(){
        if(data!=null)
          return data;
        else
          return Integer.toString(id);
     }

}
